package com.xdclass.service.dubbo;

import com.xdclass.VO.UserVO;
import com.xdclass.mapper.TUserMapper;
import com.xdclass.model.TUser;
import com.xdclass.service.UserService;
import javax.annotation.Resource;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * ClassName:UserService Package:com.xdclass.service Description:
 *
 * @Date:2021/7/2 11:40
 * @Author:sunzheng@beiming.com
 */
@Service("userService")
public class UserServiceImpl implements UserService {

  @Resource
  private TUserMapper tUserMapper;

  /**
   * 通过用户id获取用户信息接口
   * @param id
   * @return
   */
  @Override
  public UserVO getUserById(Integer id) {

    TUser user = tUserMapper.selectByPrimaryKey(id);
    UserVO userVO = new UserVO();
    BeanUtils.copyProperties(user, userVO);
    return userVO;
  }

}
